package com.example.autumn.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.example.autumn.entity.Account;
import com.example.autumn.mapper.AccountMapper;
import com.example.autumn.service.IAccountService;
import com.example.common.response.R;
import org.springframework.stereotype.Service;

/**
 * @author Liaorun
 */
@Service
public class IAccountServiceImpl extends ServiceImpl<AccountMapper, Account> implements IAccountService {

    @Override
    public R<Account> getAccountById(Integer id) {

        Account account = this.selectById(id);
        return new R<Account>().setData(account);
    }

    @Override
    public R<Boolean> insertEntity(Account account) {
        boolean insert = this.insert(account);
        return insert ? R.SUCCESS("ok") : R.Error();
    }
}
